<?php
class MenuManageAction extends Action{
    
    public function menuManage(){
    	$this->assign("validateMenuJuri",true);
        //global $cookieTools;
        //$qiaoba = $cookieTools->getCookie('qiaoba');
        //$this->smarty->assign("qiaoba",$qiaoba);
    	tsLoad('/manage/busi/SysMenuBusi.class.php');
    	$sysMenuBusi = new SysMenuBusi();
    	$menus = $sysMenuBusi->queryMenus();
    	$this->smarty->assign("menuJsons", json_encode($menus));
    	
        $this->assign("smarty",'/manage/page/systemmanage/systemmenumanage/menuManage.html');
        return $this->SMARTY;
    }
    
    //插入一个菜单信息
    public function insertMenu(){
    	tsLoad('/manage/busi/SysMenuBusi.class.php');
    	$sysMenuBusi = new SysMenuBusi();
    	$result = $sysMenuBusi->addMenu($_POST);
    	
    	$this->assign("result",$result);
    	return $this->JSON;
    }
    
    //修改一个菜单信息
    public function updateMenu(){
    	tsLoad('/manage/busi/SysMenuBusi.class.php');
    	$sysMenuBusi = new SysMenuBusi();
    	$result = $sysMenuBusi->updateMenu($_POST);
    	 
    	$this->assign("result",$result);
    	return $this->JSON;
    }
    
    //删除一个菜单信息
    public function delMenu(){
    	tsLoad('/manage/busi/SysMenuBusi.class.php');
    	$sysMenuBusi = new SysMenuBusi();
    	$result = $sysMenuBusi->delMenu($_POST);
    
    	$this->assign("result",$result);
    	return $this->JSON;
    }
    
    //通过一个菜单id查询一个菜单信息
    public function queryMenuOne(){
    	tsLoad('/manage/busi/SysMenuBusi.class.php');
    	$sysMenuBusi = new SysMenuBusi();
    	$menu = $sysMenuBusi->queryMenuOne($_POST);
    
    	$this->assign("menu",$menu);
    	return $this->JSON;
    }
}
?>